#!/bin/bash
# splits sam up by sizes.
# parameters.
indir=$1
outdir=$2

# check size.
for x in $(ls ${indir}/*); do
	# check size.
	sz=$(wc -l $x | awk '{print $1}');
	
	if [ $sz -lt 2000000 ]; then
		y=$(basename $x);
		cp $x ${outdir}/${bname}
	fi
	
	# get basename.
	#bname=$(basename $x .sam);
	
	# echo split
	#echo $bname, $sz;
	#split -d -l 2000000 $x ${outdir}/${bname}_
done;

